Javascript object becomes undefined when appended to another object

welcome to shbcf.ru